﻿
// Copyright © 2009 Mehdi Golchin. All rights reserved.

function TinyMceValidatorEvalulateIsValid(val) {

    if (tinymce) {
        var instance = tinymce.EditorManager.getInstanceById(val.controltovalidate);
        var value = instance.getContent();
        
        if (val.isrequired == "true" && value == val.initialvalue.toString())
            return false;

        if (val.maximumlength != -1 && value.length > val.maximumlength)
            return false;

        return true;
    }
    
}